@model Mod.CookieDetector.Models.CookieDetectionSettingsPart
@using Orchard.ContentManagement;
@using Mod.CookieDetector.HtmlHelpers;

@{
    Script.Require("jQuery").AtHead();
    Script.Require("colorbox").AtHead();
    Style.Require("colorbox.default").AtHead();
    
    var url = "~/Modules/Mod.CookieDetector/Content/";
    
    var imageList = new List<SelectListItem>() {
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "caught.jpeg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "cookie.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "cookie_jar.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "darkside.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "handincookiejar.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "nocookies-main.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "nocookies.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "twaddle-cat.jpg") },
        new SelectListItem() { Text = "Cookie", Value = Url.Content(url + "yunodarkside.jpg") },
        new SelectListItem() { Text = "Cookie", Value = "None" }
    };
}

<fieldset>
    <legend>@T("Cookie Detection Settings")</legend>

    <div>
        @Html.LabelFor(m => m.AlertCookieBlockers, @T("Alert The Cookie Blockers"))
        <div class="hint">Hide the login and replace with a message or picture to tell them 
        they are naughty users</div>
        @Html.EditorFor(m => m.AlertCookieBlockers)
        @Html.ValidationMessageFor(m => m.AlertCookieBlockers, "*")
        
    </div>
    <div data-controllerid="@Html.FieldIdFor(m => m.AlertCookieBlockers)">
        <div>
            @Html.LabelFor(m => m.TopMessage, @T("Top Message"))
            <div class="hint">Message displayed above optional image, feel free to use html</div>
            @Html.TextAreaFor(m => m.TopMessage)
            @Html.ValidationMessageFor(m => m.TopMessage, "*")
            
        </div>
        <div>
            @Html.LabelFor(m => m.Image, @T("Image"))
            <div class="hint">Optional image to be displayed, select broken image at the end for no image, 
            or leave blank (Professional in my book is just another word for lazy)</div>
            @Html.RadioButtonImageList(m => m.Image, imageList, "40", "40")
                                    
            @*<input type="radio" value="caught.jpg" name="CookieDetectionSettingsPart.Image" id="CookieDetectionSettingsPart_Image" />*@
            
        </div>
        <div>
            @Html.LabelFor(m => m.BottomMessage, @T("Bottom Message"))
            <div class="hint">Message displayed below optional image, feel free to use html</div>
            @Html.TextAreaFor(m => m.BottomMessage)
            @Html.ValidationMessageFor(m => m.BottomMessage, "*")
            
        </div>
    </div>
</fieldset>

<script type="text/javascript">
    $(".Cookie").colorbox({ rel: 'Cookie' });
</script>